import 'package:flutter/material.dart';
import '../models/member.dart';

class MemberFilterProvider with ChangeNotifier {
  MemberRole? _selectedRole;
  
  MemberRole? get selectedRole => _selectedRole;
  
  void setRole(MemberRole? role) {
    if (_selectedRole != role) {
      _selectedRole = role;
      notifyListeners();
    }
  }

  String getRoleName(MemberRole? role) {
    switch (role) {
      case MemberRole.admin:
        return '管理员';
      case MemberRole.member:
        return '普通成员';
      case MemberRole.guest:
        return '访客';
      default:
        return '所有成员';
    }
  }

  IconData getRoleIcon(MemberRole? role) {
    switch (role) {
      case MemberRole.admin:
        return Icons.admin_panel_settings;
      case MemberRole.member:
        return Icons.person;
      case MemberRole.guest:
        return Icons.person_outline;
      default:
        return Icons.people_outline;
    }
  }
} 